﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Gds.Model.ConfigModel.BasicSystemInfo
{
    public class LocalSystemConfig : INotifyPropertyChanged
    {
        private bool _isMainServer;
        private bool _isClientModel;
        private string _voiceLoopTime="1";
        private bool _isSpeakForever;
        private bool _isContainerBackUpServer;
        private bool _isAutoRun;
        private bool _isChangeStateStr;
        private string _lowAlarmStr = "高报";
        private string _highAlarmStr = "高高报";
        private string _serverIp = "localhost";
        private string _backUpserverIp = "localhost";
        private int _maxHeartBeatSecond = 3;
        private int _heartBeatCheckSplit = 10;
        private int _dataSaveMaxDay = 30;
        private bool _isServerControlRelay = false;
        private bool _isPcCalcPGasMeterState = false;
        private string _readSplit = "1000";
        private int _delHistoryHour = 1;
        private bool _isO2defaultOk=false;


        /// <summary>
        ///  语音播报间隔
        /// </summary>
        public string VoiceLoopTime
        {
            get { return _voiceLoopTime; }
            set { _voiceLoopTime = value; OnPropertyChange("VoiceLoopTime"); }
        }
        /// <summary>
        /// 持续播报
        /// </summary>
        public bool IsSpeakForever
        {
            get { return _isSpeakForever; }
            set { _isSpeakForever = value; OnPropertyChange("IsSpeakForever"); }
        }
        /// <summary>
        ///  是否服务器模式 或者工控机模式
        /// </summary>
        public bool IsClientModel
        {
            get { return _isClientModel; }
            set { _isClientModel = value; OnPropertyChange("IsClientModel"); }
        }
        /// <summary>
        /// 是否主服务器
        /// </summary>
        public bool IsMainServer
        {
            get { return _isMainServer; }
            set { _isMainServer = value; OnPropertyChange("IsMainServer"); }
        }
        /// <summary>
        /// 是否包含备用服务器
        /// </summary>
        public bool IsContainerBackUpServer
        {
            get { return _isContainerBackUpServer; }
            set { _isContainerBackUpServer = value; OnPropertyChange("IsContainerBackUpServer"); }
        }
        /// <summary>
        /// 是否自动开始通讯
        /// </summary>
        public bool IsAutoRun
        {
            get { return _isAutoRun; }
            set { _isAutoRun = value; OnPropertyChange("IsAutoRun"); }
        }
        /// <summary>
        /// 是否转换状态描述文字
        /// </summary>
        public bool IsChangeStateStr
        {
            get { return _isChangeStateStr; }
            set { _isChangeStateStr = value; OnPropertyChange("IsChangeStateStr"); }
        }
        /// <summary>
        /// 是否服务器控制继电器模块
        /// </summary>
        public bool IsServerControlRelay
        {
            get { return _isServerControlRelay; }
            set { _isServerControlRelay = value; OnPropertyChange("IsServerControlRelay"); }
        }
        /// <summary>
        /// 低警转换文字
        /// </summary>
        public string LowAlarmStr
        {
            get { return _lowAlarmStr; }
            set { _lowAlarmStr = value; OnPropertyChange("LowAlarmStr"); }
        }
        /// <summary>
        /// 高警转换文字
        /// </summary>
        public string HighAlarmStr
        {
            get { return _highAlarmStr; }
            set { _highAlarmStr = value; OnPropertyChange("HighAlarmStr"); }
        }
        /// <summary>
        /// 服务器ip地址
        /// </summary>
        public string ServerIp
        {
            get { return _serverIp; }
            set { _serverIp = value; OnPropertyChange("ServerIp"); }
        }
        /// <summary>
        /// 备用服务器ip地址
        /// </summary>
        public string BackUpserverIp
        {
            get { return _backUpserverIp; }
            set { _backUpserverIp = value; OnPropertyChange("BackUpserverIp"); }
        }
        /// <summary>
        /// 最大心跳等待时间
        /// </summary>
        public int MaxHeartBeatSecond
        {
            get { return _maxHeartBeatSecond; }
            set { _maxHeartBeatSecond = value; OnPropertyChange("MaxHeartBeatSecond"); }
        }
        /// <summary>
        /// 心跳检测间隔
        /// </summary>
        public int HeartBeatCheckSplit
        {
            get { return _heartBeatCheckSplit; }
            set { _heartBeatCheckSplit = value; OnPropertyChange("HeartBeatCheckSplit"); }
        }
        /// <summary>
        /// 数据保存最大天数
        /// </summary>
        public int DataSaveMaxDay
        {
            get { return _dataSaveMaxDay; }
            set { _dataSaveMaxDay = value; OnPropertyChange("DataSaveMaxDay"); }
        }
        /// <summary>
        /// 删除历史数据小时
        /// </summary>
        public int DelHistoryHour
        {
            get { return _delHistoryHour; }
            set { _delHistoryHour = value; OnPropertyChange("DelHistoryHour"); }
        }
        /// <summary>
        /// 通讯间隔
        /// </summary>
        public string ReadSplit
        {
            get { return _readSplit; }
            set { _readSplit = value; OnPropertyChange("ReadSplit"); }
        }
        
        /// <summary>
        /// 是否手动计算探头误差
        /// </summary>
        public bool IsPcCalcPGasMeterState
        {
            get { return _isPcCalcPGasMeterState; }
            set { _isPcCalcPGasMeterState = value; OnPropertyChange("IsPcCalcPGasMeterState"); }
        }
        /// <summary>
        /// 氧气默认合格
        /// </summary>
        public bool IsO2defaultOk
        {
            get { return _isO2defaultOk; }
            set
            {
                _isO2defaultOk = value;
                OnPropertyChange("IsO2defaultOk");
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;
        public virtual void OnPropertyChange(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

    }
}
